<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');


// Define a path alias for the Bootstrap extension as it's used internally.
// In this example we assume that you unzipped the extension under protected/extensions.
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'homeUrl' => array('/dashboard'),
	'name'=>'Yamii for Business',
	//'theme'=>'charisma',//use the charisma template
	'theme'=>'ace',

	'preload' => array(
		'log',	// preloading 'log' component
		'bootstrap', // preload the bootstrap component
	),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		//if controler is in subfolder admin,
		//then view should have the same structure such as view/admin/index.php
		//'application.controllers.admin.*',
	),

	'modules'=>array(
		'api',
		'apidev',
		'tools',//this is for management
		// uncomment the following to enable the Gii tool
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'_admin_',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			//'ipFilters'=>array('127.0.0.1','::1'),
		),
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
			//alpha version
			'loginUrl'=>array('accounts/login'),
		),
		// uncomment the following to enable URLs in path-format
		'urlManager'=>array(
			'showScriptName' => false,
			'urlFormat' => 'path',
			'rules' => array(
                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		//This makes the LocalTime class available as Yii::app()->localtime
		'localtime' => array(
			'class' => 'LocalTime',
		),
		//This makes the timeago class available as Yii::app()->format->timeago(time() - 60 * 5)
		'format'=>array(
			'class'=>'application.extensions.timeago.TimeagoFormatter',
		),
		'bootstrap' => array(
			'class' => 'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
		),
		'clientScript' => array(
			'scriptMap' => array(
				'jquery.js' => false,
				'jquery.min.js' => false,
			),
		),
		'db' => array(
			'connectionString' => 'mysql:host=localhost;dbname=yamiifi_prod1',
			'emulatePrepare' => true,
			'username' => 'yamiifi_prod1',
			'password' => 'yamii_prod1',
			'charset' => 'utf8',
			'enableProfiling' => true,	// enable profiling
			'enableParamLogging' => true,	// enable logging
			//'initSQLs'=>array("SET time_zone='Europe/Helsinki'"),
		),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning, info',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
		'cache' => array(
            'class' => 'system.caching.CFileCache',
		),
		'ePdf' => array(
			'class' => 'ext.yii-pdf.EYiiPdf',
			'params' => array(
				'HTML2PDF' => array(
					'librarySourcePath' => 'application.vendors.html2pdf.*',
					'classFile'         => 'html2pdf.class.php', // For adding to Yii::$classMap
					'defaultParams'     => array( // More info: http://wiki.spipu.net/doku.php?id=html2pdf:en:v4:accueil
                        'orientation' => 'P', // landscape or portrait orientation
                        'format'      => 'A4', // format A4, A5, ...
                        'language'    => 'en', // language: fr, en, it ...
                        'unicode'     => true, // TRUE means clustering the input text IS unicode (default = true)
                        'encoding'    => 'UTF-8', // charset encoding; Default is UTF-8
                        'marges'      => array(0, 0, 0, 0), // margins by default, in order (left, top, right, bottom)
                    )
				),
			),
		),
	),

	//dashboard version
	'defaultController' => 'intro',

	// application-level parameters that can be accessed using Yii::app()->params['paramName']
	'params'=>array(
		'version' => 2.0,
		// this is used in contact page
		'adminEmail'=>'business@yamii.fi',
		'pageSize' => 20,
		'uploadUrl' => '/upload/merchants/',
		'uploadPath' => '/upload/merchants/',
		'facebook' => array(
			'appId'  => '422576134463730',
			'secret' => '58aa558cf80ddaad60c732114eeba116',
		),
	),
	
	'language' => 'en_gb',
);